/**
 * @Copyright：<a href="www.wisesoft.net.cn">fxsen</a>
 * @Author: <a href="mailto:fxsen@foxmail.com">Fxsen</a>
 * @CreateTime: 2022年08月03日  15:06
 */
package com.fxsen.platform.core;

import com.fxsen.commons.web.core.config.Knife4jConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 *@Author: <a href="mailto:fxsen@foxmail.com">Fxsen</a>
 *@CreateTime: 2022年08月03日  15:06
 */
//@Configuration
public class PlatformKnife4jConfig extends Knife4jConfig {
    @Bean
    public Docket platform() {
        return new Docket(DocumentationType.OAS_30)
                .apiInfo(new ApiInfoBuilder()
                        .title(title)
                        .description(description)
                        // .termsOfServiceUrl("http://www.xx.com/")
                        .contact(new Contact("fxsen", "", "fxsen@foxmail.com"))
                        .version("1.0")
                        .build())
                // 分组名称
                .groupName("系统功能")
                .select()
                // 这里指定Controller扫描包路径
                .apis(RequestHandlerSelectors.basePackage("com.fxsen.platform"))
                .paths(PathSelectors.any())
                .build();
    }
}
